import request from "@/plugin/axios";

const BASE_URL = "sys/area";

export function AreaTree(parentId) {
  return request({
    url: BASE_URL + "/" + parentId,
    method: "get",
  });
}

export function AreaAdd(data) {
  return request({
    url: BASE_URL,
    method: "post",
    data,
  });
}

export function AreaUpdate(data) {
  return request({
    url: BASE_URL + "/" + data.id,
    method: "put",
    data,
  });
}

export function AreaDelete(id) {
  return request({
    url: BASE_URL + "/" + id,
    method: "delete",
  });
}

export function AreaSearch(data) {
  return request({
    url: BASE_URL + "/search-area",
    method: "get",
    params: data,
  });
}
